<!DOCTYPE html>
<html>
<head>
	<title>智能聊天</title>
	<link rel="stylesheet" href="__ROOT__/static/css/amazeui.min.css">
<script typet="text/javascript" src="__ROOT__/static/js/jquery-3.1.1.min.js"></script>
<script typet="text/javascript" src="__ROOT__/static/js/amazeui.min.js"></script>
</head>
<body>
<textarea readonly="" id="record" style="width: 600px;height: 400px;resize: none;"></textarea><br><br>
<textarea id="msg" style="width: 600px;height: 200;resize: none;"></textarea><br><br>
<input type="button" name="" id="sub_btn" value="发送">

</body>
<script type="text/javascript">
	$('#sub_btn').on('click',function(){
		var msg = $('#msg').val();
		if(msg==""){
			$('#record').append("菲菲：你倒是说话啊\n");return 0;
					}
		$('#msg').val("");
		$('#record').append("我："+msg+"\n");
		$.ajax({
			url:"{:url('index/chat/return_msg')}",
			type:"post",
			dataType:"json",
			data:{
				'msg':msg
			},
			success:function(data){
				// alert(data.msg);
				$('#record').append("菲菲："+data.msg+"\n");
			}
		})
	})
</script>
</html>